package com.witmore.skyline.web.service;

import com.witmore.skyline.db.entity.CameraDO;
import com.witmore.skyline.db.entity.DeviceDO;
import com.witmore.skyline.web.controller.enums.CameraPicSourceTypeEnum;
import com.witmore.skyline.web.controller.vo.param.CameraBindDeviceParamVO;
import com.witmore.skyline.web.controller.vo.param.CameraListParamVO;
import com.witmore.skyline.web.controller.vo.param.CameraParamVO;
import com.witmore.skyline.web.controller.vo.param.CameraUpdateNameParamVO;
import com.witmore.skyline.web.controller.vo.param.CameraUpdateDeviceSnParamVO;
import com.witmore.skyline.web.controller.vo.result.CameraResultVO;
import com.witmore.skyline.web.controller.vo.result.ResponsePageResult;
import com.witmore.skyline.web.controller.vo.result.ResponseResult;
import com.witmore.skyline.web.service.third.tplink.dto.DeviceSDCardInfo;
import com.witmore.skyline.web.service.third.tplink.dto.DeviceVideoDayInfo;
import com.witmore.skyline.web.service.third.tplink.dto.DeviceVideoInfoDTO;
import com.witmore.skyline.web.service.third.yjx.dto.CameraDTO;
import com.witmore.skyline.web.service.third.yjx.dto.CameraLiveDTO;

import java.util.List;

/**
 * Description: CameraService
 * Author: 豆子高
 * Date: 2025/2/26 15:35
 */
public interface CameraService {
    /**
     * 摄像头信息入库以及与设备的关系绑定 （事务）
     */
    void getAndSaveCameraList(DeviceDO deviceDO, List<CameraDTO> cameraDTOS);

    /**
     * 根据摄像头序列号获取直播地址
     */
    ResponseResult<CameraLiveDTO> getCameraLiveUrl(CameraParamVO cameraParamVO) throws Exception;

    /**
     * 摄像头列表
     */
    ResponsePageResult<CameraResultVO> getCameraList(CameraListParamVO paramPageVO);

    /**
     * 根据设备id获取摄像头列表
     */
    ResponseResult<List<CameraResultVO>> getCameraListByDevice(Integer skylineDeviceId, Integer orgId, Integer cameraPicCount);

    /**
     * 保存摄像头图片
     */
    void saveCameraPic(CameraDO cameraDO, String ossUrl, CameraPicSourceTypeEnum sourceTypeEnum);

    /**
     * 转存图片地址
     */
    String convertOssUrl(String fileName, String getUrl);

    /**
     * 搜索存在回放录像的日期
     */
    ResponseResult<List<DeviceVideoInfoDTO>> searchVideoYear(List<String> cameraSnList, String year);

    /**
     * 搜索当天录像数据
     */
    ResponseResult<DeviceVideoDayInfo> searchVideoDay(String cameraSn, String searchDay, Integer startIdx, Integer endIdx);

    /**
     * 搜索当天所有人形侦测录像数据
     */
    ResponseResult<DeviceVideoDayInfo> searchHumanDetectionVideo(String cameraSn, String searchDay);

    /**
     * 获取设备SD卡信息
     */
    ResponseResult<List<DeviceSDCardInfo>> getDeviceSDCardInfo(String cameraSn);

    /**
     * 设备绑定摄像头（包含编辑摄像头信息功能）
     */
    ResponseResult<Void> bindCameraToDevice(CameraBindDeviceParamVO paramVO);

    /**
     * 编辑摄像头名称
     */
    ResponseResult<Void> updateCameraName(CameraUpdateNameParamVO paramVO);

    /**
     * 编辑摄像头设备序列号
     */
    ResponseResult<Void> updateCameraDeviceSn(CameraUpdateDeviceSnParamVO paramVO);
}
